KISSY.use("node",function(S,Node){ 
	var mask = ("<div style=\"width:100%;left:0;top:0;height:100%;position:fixed;\" class=\"bui-ext-mask\"></div>");
	$(".chk").on("click",function(){
		var sid = $(this).attr("data-sid");
		var nick = $(this).attr("data-nick");
		chkshopattr(sid,nick);
	});
	$(".pass").on("click",function(){
		var shoptitle = $(this).attr("data-title");
		var mixednick = $(this).attr("data-xnick");
		passshop_box(shoptitle,mixednick);
	});
	$(".reject").on("click",function(){
		var shoptitle = $(this).attr("data-title");
		var mixednick = $(this).attr("data-xnick");
		rejectshop_box(shoptitle,mixednick);
	});
	
	$(".refond").on("click",function(){
		var shoptitle = $(this).attr("data-title");
		var mixednick = $(this).attr("data-xnick");
		refondshop_box(shoptitle,mixednick);
	});
	$(".mailto").on("click",function(){
		var shoptitle = $(this).attr("data-title");
		var mixednick = $(this).attr("data-xnick");
		var msgid = $(this).attr("data-msgid")?$(this).attr("data-msgid"):0;
		sendmsg_box(shoptitle,mixednick,msgid);
	});
	function chkshopattr(sid,nick){
		$(".doc-content").addClass("height240");
		$(mask).insertBefore(".doc-content");
			var dialog = ("<div class=\"row\">");
			dialog+=('     <div class="tips tips-small tips-warning">');
			dialog+=('     <span class="x-icon x-icon-small x-icon-error"><i class="icon icon-white icon-bell"></i></span>');
			dialog+=('     <div class="tips-content">检查店铺状态');
			dialog+=('     </div>');
			dialog+=('     </div>');
			dialog+=("</div>");
			dialog+=("<div class=\"row loading\">");
			dialog+=("                <div class=\"control-group pull-left span4\">");
			dialog+=("                    <label class=\"control-label\">");
			dialog+=("                        <a href=\"http://shop"+sid+".taobao.com\" target=\"_blank\">店铺状态</a>：");
			dialog+=("                    </label>");
			dialog+=("                    <div class=\"controls shop_status\">");
			dialog+=("                    </div>");
			dialog+=("                </div>");

			dialog+=("                <div class=\"control-group pull-left span5\">");
			dialog+=("                    <label class=\"control-label\">");
			dialog+=("                        <a href=\"http://shop"+sid+".taobao.com\" target=\"_blank\">基本信息</a>：");
			dialog+=("                    </label>");
			dialog+=("                    <div class=\"controls shop_baseinfo\">");
			dialog+=("                    </div>");
			dialog+=("                </div>");
			dialog+=("                <div class=\"control-group pull-left span5\">");
			dialog+=("                    <label class=\"control-label\">");
			dialog+=("                        <a href=\"http://shop"+sid+".taobao.com\" target=\"_blank\">店铺数据</a>：");
			dialog+=("                    </label>");
			dialog+=("                    <div class=\"controls shop_data\">");
			dialog+=("                    </div>");
			dialog+=("                </div>");
			dialog+=("                <div class=\"control-group pull-left span5\">");
			dialog+=("                    <label class=\"control-label\">");
			dialog+=("                        <a href=\"http://shop"+sid+".taobao.com\" target=\"_blank\">行业数据</a>：");
			dialog+=("                    </label>");
			dialog+=("                    <div class=\"controls indu_data\">");
			dialog+=("                    </div>");
			dialog+=("                </div>");
			dialog+=("</div>");
			dialog+=("<div class=\"row loading\">");
			dialog+=("                <div class=\"control-group pull-left \">");
			dialog+=("                    <label class=\"control-label\">");
			dialog+=("                        <span class=\"button getmsg\" data-sid=\""+sid+"\">读取审核信息</span>");
			dialog+=("                    </label>");
			dialog+=("                    <div class=\"controls shop_msg\">");
			dialog+=("                    </div>");
			dialog+=("                </div>");
			dialog+=("</div>");
			$(__dialog("检查店铺属性",dialog)).insertBefore(".doc-content");
			$(".bui-ext-close-x").on("click",function(){$(".bui-ext-mask").remove();$(".bui-dialog").remove();$(".doc-content").removeClass("height240");});	
			$(".cancel").on("click",function(){$(".bui-ext-mask").remove();$(".bui-dialog").remove();$(".doc-content").removeClass("height240");});	
			$(".getmsg").on("click",function(){
			var sid = $(this).attr("data-sid");
				KISSY.io({
				url: "/?a=ajaxmsglist&m=home&c=admin",
				data:{"sid":sid,"ac":"Allshops"},
				success: function(data, textStatus) {
					if(data.total!=0){
						var keys=[];
						keys.push(data.a);
						keys.push(data.b);
						keys.push(data.c);
						keys.push(data.d);
						keys.push(data.e);
						keys.push(data.f);
						keys.push(data.g);
						keys.push(data.h);
						keys.push(data.i);
						keys.push(data.j);
						keys.forEach(function(k){
							var msg = "由"+(k.fromshop?k.fromshop:"管理员")+"发给"+k.toshop+"："+k.message;
							var html = "<div><span class=\"x-icon x-icon-small x-icon-success\"><i class=\"icon icon-white icon-share-alt\"></i></span>"+msg+"</div>";
							$(".shop_msg").empty();
							$(html).appendTo(".shop_msg");
						});
					}else{
						var msg="没有任何消息";
						var html = "<div><span class=\"x-icon x-icon-small x-icon-success\"><i class=\"icon icon-white icon-share-alt\"></i></span>"+msg+"</div>";
						$(".shop_msg").empty();
						$(html).appendTo(".shop_msg");
					}
				},
				error: function(){
					alert('error');
				},
				//发送请求类型是jsonp
				dataType:"jsonp"
				});
			});
			KISSY.io({
			url: "/?a=getshopattr&m=home&c=admin",
			data: {"sid":sid,"nick":nick},
			success: function(data, textStatus) {
				$(".row.loading").removeClass("loading");
				var str = ('<ul class="render-byjs">');
					str+=('    <li>');
					str+=('        描述相符：');
					str+=('            <em class="count" title="4.80727">');
					str+=('                '+data.item_score);
					str+=('            </em>');
					str+=('    </li>');
					str+=('    <li>');
					str+=('        服务态度：');
					str+=('            <em class="count" title="4.80125">');
					str+=('                '+data.service_score);
					str+=('            </em>');
					str+=('    </li>');
					str+=('    <li>');
					str+=('        发货速度：');
					str+=('            <em class="count" title="4.81248">');
					str+=('                '+data.delivery_score);
					str+=('            </em>');
					str+=('    </li>');
					str+=('</ul>');
				$(str).appendTo(".shop_status");
				var str = ('<ul class="render-byjs">');
					str+=('    <li>');
					str+=('        店铺类型：');
					str+=('            <em>');
					str+=('                '+data.tmall==1?"<span class=\"badge badge-error\">天猫</span>":"集市");
					str+=('            </em>');
					str+=('    </li>');
					str+=('    <li>');
					str+=('        开店时间：');
					str+=('            <em>');
					str+=('                '+data.created);
					str+=('            </em>');
					str+=('    </li>');
					str+=('    <li>');
					str+=('        商品总数：');
					str+=('            <em>');
					str+=('                '+data.auctionCount);
					str+=('            </em>');
					str+=('    </li>');
				$(str).appendTo(".shop_baseinfo");
				var str = ('<ul class="render-byjs">');
					str+=('    <li>');
					str+=('        30天退款速度：');
					str+=('            <em>');
					str+=('                '+data.srt+(data.srt>data.art?"<i class=\"icon icon-arrow-up icon-red\"></i>":"<i class=\"icon icon-arrow-down icon-green\"></i>"));
					str+=('            </em>');
					str+=('    </li>');
					str+=('    <li>');
					str+=('        30天退款率：');
					str+=('            <em>');
					str+=('                '+data.srtp+(data.srtp>data.arr?"<i class=\"icon icon-arrow-up icon-green\"></i>":"<i class=\"icon icon-arrow-down icon-red\"></i>"));
					str+=('            </em>');
					str+=('    </li>');
					str+=('    <li>');
					str+=('        30天投诉率：');
					str+=('            <em>');
					str+=('                '+data.ccp+(data.ccp>data.acr?"<i class=\"icon icon-arrow-up icon-green\"></i>":"<i class=\"icon icon-arrow-down icon-red\"></i>"));
					str+=('            </em>');
					str+=('    </li>');
					str+=('    <li>');
					str+=('        30天处罚数：');
					str+=('            <em>');
					str+=('                '+data.punc+(data.punc>data.apts?"<i class=\"icon icon-arrow-up icon-green\"></i>":"<i class=\"icon icon-arrow-down icon-red\"></i>"));
					str+=('            </em>');
					str+=('    </li>');
					str+=('    <li>');
					str+=('        好评率：');
					str+=('            <em>');
					str+=('                '+data.gerd+(data.gerd>data.iasgr?"<i class=\"icon icon-arrow-up icon-red\"></i>":"<i class=\"icon icon-arrow-down icon-green\"></i>"));
					str+=('            </em>');
					str+=('    </li>');
				$(str).appendTo(".shop_data");
				var str = ('<ul class="render-byjs">');
					str+=('    <li>');
					str+=('        30天退款速度：');
					str+=('            <em>');
					str+=('                '+data.art);
					str+=('            </em>');
					str+=('    </li>');
					str+=('    <li>');
					str+=('        30天退款率：');
					str+=('            <em>');
					str+=('                '+data.arr);
					str+=('            </em>');
					str+=('    </li>');
					str+=('    <li>');
					str+=('        30天投诉率：');
					str+=('            <em>');
					str+=('                '+data.acr);
					str+=('            </em>');
					str+=('    </li>');
					str+=('    <li>');
					str+=('        30天处罚数：');
					str+=('            <em>');
					str+=('                '+data.apts);
					str+=('            </em>');
					str+=('    </li>');
					str+=('    <li>');
					str+=('        好评率(周)：');
					str+=('            <em>');
					str+=('                '+data.iasgr);
					str+=('            </em>');
					str+=('    </li>');
				$(str).appendTo(".indu_data");
			},
			error: function(){
				alert('error');
			},
			dataType:"jsonp"
			});
	}
	
	$(".bui-nav-tab-item").on("click",function(){
		$(".bui-nav-tab-item").removeClass("tab-nav-actived");
		$(this).addClass("tab-nav-actived");
		var ac =$(this).attr('data-name');
		if(ac=="Allshops"||ac=="Auditing"||ac=="Audited"||ac=="Punished"||ac=="Blaklist")
		loadshoppage(1,ac);
	});
	function loadshoppage(curpg,ac){
		KISSY.io({
			url: "/?a=ajax&m=home&c=admin",
			data: {"ac":ac,"p":curpg},
			success: function(data, textStatus) {
			setPage($('.pagination'),data.totalpg,curpg);
			$(".tbodya").empty();
			if(data.total>0){
				var keys=[];
				keys.push(data.a);
				keys.push(data.b);
				keys.push(data.c);
				keys.push(data.d);
				keys.push(data.e);
				keys.push(data.f);
				keys.push(data.g);
				keys.push(data.h);
				keys.push(data.i);
				keys.push(data.j);
				keys.forEach(function(k){
					$(".clone .c2").empty();
					$(".clone .c3").empty();
					$(".clone .c4").empty();
					$(".clone .c5").empty();
					$(".clone .c6").empty();
					var html='';
					if (k.status=="2"){
						 html = '<span class="x-icon x-icon-small x-icon-success x-icon'+k.sid+'"><i class="icon icon-white icon-ok icon'+k.sid+'"></i></span>';
					}else if(k.status=="3"){
						 html = '<span class="x-icon x-icon-small x-icon-error x-icon'+k.sid+'"><i class="icon icon-white  icon-question-sign icon'+k.sid+'"></i></span>';
					}else if(k.status=="1"){
						 html = '<span class="x-icon x-icon-small x-icon-warning x-icon'+k.sid+'"><i class="icon icon-white icon-warning icon'+k.sid+'"></i></span>';
					}else if(k.status=="4"){
						 html = '<span class="x-icon x-icon-small x-icon-warning x-icon'+k.sid+'"><i class="icon icon-white icon-refresh icon'+k.sid+'"></i></span>';
					}else if(k.status=="5"){
						 html = '<span class="x-icon x-icon-small label-inverse x-icon'+k.sid+'"><i class="icon icon-white icon-ban-circle icon'+k.sid+'"></i></span>';
					}
					$(html).appendTo($(".clone .c2"));
					html = '<a href="http://shop'+k.sid+'.taobao.com/?spm=0.0.0.0.tp15xa" target="_blank" data-spm-anchor-id="0.0.0.0">'+k.shoptitle+'</a>';
					html += '<button class="button button-mini button-warning chk" data-title="'+k.shoptitle+'" data-sid="'+k.sid+'">检查</button>';
					html += ('<div class="pull-right">');
					html += ('<button class="button button-mini button-primary pass" data-title="'+k.shoptitle+'" data-xnick="'+k.sid+'">审核通过</button> ');
					if(k.status=="5"){
						var mark = '取消黑名单';
						var css = 'warning refond';
					}else{
						var mark = '驳回申请';
						var css = 'danger reject';
					}
					html += ('<button class="button button-mini button-'+css+'" data-title="'+k.shoptitle+'" data-xnick="'+k.sid+'">'+mark+'</button> ');
					html += ('<button class="button button-mini mailto" data-title="'+k.shoptitle+'" data-xnick="'+k.sid+'">发信</button> ');
					html += ('</div>');
					$(html).appendTo($(".clone .c3"));
					html = "<span>"+(k.truename)+"</span><i class=\"icon icon-envelope mailto\" data-title=\""+k.shoptitle+"\" data-xnick=\""+k.mixednick+"\"></i>";
					$(html).appendTo($(".clone .c4"));
					html = '<a target="_blank" href="http://amos.alicdn.com/getcid.aw?spm=0.0.0.0.tp15xa&amp;v=2&amp;uid='+k.usernick+'&amp;site=cntaobao&amp;s=1&amp;groupid=0&amp;charset=utf-8" data-spm-anchor-id="0.0.0.0"><img border="0" src="http://amos.alicdn.com/online.aw?v=2&amp;uid='+k.usernick+'&amp;site=cntaobao&amp;s=1&amp;charset=utf-8" alt="点这里给我发消息"></a>'
					$(html).appendTo($(".clone .c5"));
					html = '<span>'+k.mobile+'</span>';
					$(html).appendTo($(".clone .c6"));
					var t = $(".clone").clone(true,true,true);
					t.removeClass("clone hidden");
					t.attr("data-sid",k.sid);
					t.appendTo($('.tbodya'));
					// $(".chk").on("click",function(){
						// var sid = $(this).attr("data-sid");
						// var nick = $(this).attr("data-nick");
						// chkshopattr(sid,nick);
					// });
					
					// $(".pass").on("click",function(){
						// var shoptitle = $(this).attr("data-title");
						// var mixednick = $(this).attr("data-xnick");
						// passshop_box(shoptitle,mixednick);
					// });
					// $(".reject").on("click",function(){
						// var shoptitle = $(this).attr("data-title");
						// var mixednick = $(this).attr("data-xnick");
						// rejectshop_box(shoptitle,mixednick);
					// });
					// $(".refond").on("click",function(){
						// var shoptitle = $(this).attr("data-title");
						// var mixednick = $(this).attr("data-xnick");
						// refondshop_box(shoptitle,mixednick);
					// });
				});
				
			}

			},
			//function 请求完成的回调，在 success 调用之后触发,参数同 success
			complete: function(data){
					$(".chk").on("click",function(){
						var sid = $(this).attr("data-sid");
						var nick = $(this).attr("data-nick");
						chkshopattr(sid,nick);
					});
					$(".pass").on("click",function(){
						var shoptitle = $(this).attr("data-title");
						var mixednick = $(this).attr("data-xnick");
						passshop_box(shoptitle,mixednick);
					});
					$(".reject").on("click",function(){
						var shoptitle = $(this).attr("data-title");
						var mixednick = $(this).attr("data-xnick");
						rejectshop_box(shoptitle,mixednick);
					});
					
					$(".refond").on("click",function(){
						var shoptitle = $(this).attr("data-title");
						var mixednick = $(this).attr("data-xnick");
						refondshop_box(shoptitle,mixednick);
					});
					$(".mailto").on("click",function(){
						var shoptitle = $(this).attr("data-title");
						var mixednick = $(this).attr("data-xnick");
						var msgid = $(this).attr("data-msgid")?$(this).attr("data-msgid"):0;
						sendmsg_box(shoptitle,mixednick,msgid);
					});
			},
			// 请求错误时的回调
			error: function(){
				alert('error');
			},
			//发送请求类型是jsonp
			dataType:"jsonp"
		});
}
function dialog_prepair(usernick,mixednick,msgid,type,btnstr){
	btnstr = btnstr?btnstr:'发送';
	var defaultmsg='';
	if(type=="pass"){
		defaultmsg = '恭喜'+usernick+'成功通过审核！';
	}else if(type=="reject"){
		defaultmsg = '抱歉，您的申请未通过审核。原因如下：';
	}
var dialog =("<div class=\"bui-dialog\" style=\"width:830px;visibility:visible;display:block;\">");
	dialog+=("    <div class=\"bui-stdmod-header\">");
	dialog+=("        <div class=\"header-title\">");
	dialog+=("            给"+usernick+"发送消息");
	dialog+=("        </div>");
	dialog+=("    </div>");
	dialog+=("    <div class=\"bui-stdmod-body\">");
	dialog+=("        <form method=\"post\" class=\"form-horizontal\">");
	if(type=="reject"){
	dialog+=("            <div class=\"row\">");
	dialog+=('      		<div class="tips tips-small tips-warning">');
	dialog+=('        		<span class="x-icon x-icon-small x-icon-error"><i class="icon icon-white icon-bell"></i></span>');
	dialog+=('        		<div class="tips-content">驳回'+usernick+'的登记申请：');
	dialog+=('        		</div>');
	dialog+=('      		</div>');
	dialog+=("            </div>");
	}	
	if(type=="refond"){
	dialog+=("            <div class=\"row\">");
	dialog+=('      		<div class="tips tips-small tips-notice">');
	dialog+=('        		<span class="x-icon x-icon-small x-icon-warning"><i class="icon icon-white icon-question"></i></span>');
	dialog+=('        		<div class="tips-content">取消'+usernick+'的黑名单。');
	dialog+=('        		</div>');
	dialog+=('      		</div>');
	dialog+=("            </div>");
	}
	if(type=="pass"){
	dialog+=("            <div class=\"row\">");
	dialog+=('      		<div class="tips tips-small tips-success">');
	dialog+=('        		<span class="x-icon x-icon-small x-icon-success"><i class="icon icon-white icon-ok"></i></span>');
	dialog+=('        		<div class="tips-content">批准'+usernick+'的登记申请：');
	dialog+=('        		</div>');
	dialog+=('      		</div>');
	dialog+=("            </div>");
	}
	dialog+=("            <div class=\"row\">");
	dialog+=("                <div class=\"control-group span10\">");
	dialog+=("                    <label class=\"control-label\">");
	dialog+=("                        发送给：");
	dialog+=("                    </label>");
	dialog+=("                    <div class=\"controls\">");
	dialog+=("                        <input type=\"text\" class=\"input-normal control-text usernick\" value=\""+usernick+"\" name=\"usernick\" readonly />");
	if(type=="reject"){
	dialog+=("                        <input type=\"checkbox\" class=\"control-checkbox reject\" value=\"5\" />黑名单");
	}
	dialog+=("                        <input type=\"hidden\" class=\"hide mixednick\" value=\""+mixednick+"\" name=\"mixednick\"  />");
	dialog+=("                        <input type=\"hidden\" class=\"hide fromid\" value=\""+mixednick+"\" name=\"mixednick\"  />");
	dialog+=("                        <input type=\"hidden\" class=\"hide msgid\" value=\""+msgid+"\" name=\"msgid\"  />");
	dialog+=("                    </div>");
	dialog+=("                </div>");
	dialog+=("            </div>");
	dialog+=("            <div class=\"row\">");
	dialog+=("                <div class=\"control-group span15\">");
	dialog+=("                    <label class=\"control-label\">");
	dialog+=("                        消息内容：");
	dialog+=("                    </label>");
	dialog+=("                    <div class=\"controls control-row4\">");
	dialog+=("                        <textarea class=\"input-large message\" name=\"message\">"+defaultmsg+"</textarea>");
	dialog+=("                    </div>");
	dialog+=("                </div>");
	dialog+=("            </div>");
	dialog+=("        </form>");
	dialog+=("    </div>");
	dialog+=("    <div class=\"bui-stdmod-footer\">");
	if(type=="reject"){
	dialog+=("        <button class=\"button button-danger submit\">");
	dialog+=("            "+btnstr);
	dialog+=("        </button>");
	}else if(type=="pass"){
	dialog+=("        <button class=\"button button-success submit\">");
	dialog+=("            "+btnstr);
	dialog+=("        </button>");
	}else{
	dialog+=("        <button class=\"button button-primary submit\">");
	dialog+=("            "+btnstr);
	dialog+=("        </button>");
	}
	dialog+=("        <button class=\"button button-primary cancel\">");
	dialog+=("            取消");
	dialog+=("        </button>");
	dialog+=("    </div>");
	dialog+=("    <a class=\"bui-ext-close\">");
	dialog+=("        <span class=\"bui-ext-close-x x-icon x-icon-normal\">");
	dialog+=("            ×");
	dialog+=("        </span>");
	dialog+=("    </a>");
	dialog+=("</div>");
return dialog;
}

function passshop_box(usernick,mixednick){
	$(".doc-content").addClass("height240");
	$(mask).insertBefore(".doc-content");
	$(dialog_prepair(usernick,mixednick,0,'pass','通过')).insertBefore(".doc-content");
	$(".bui-ext-close-x").on("click",function(){$(".bui-ext-mask").remove();$(".bui-dialog").remove();$(".doc-content").removeClass("height240");});	
	$(".cancel").on("click",function(){$(".bui-ext-mask").remove();$(".bui-dialog").remove();$(".doc-content").removeClass("height240");});	
	var uri = "/?a=sendmsg&m=home&c=admin&tp=pass";
	SendIoOnBtn(".submit",uri);
}
function refondshop_box(usernick,mixednick){
	$(".doc-content").addClass("height240");
	$(mask).insertBefore(".doc-content");
	$(dialog_prepair(usernick,mixednick,0,'refond','驳回')).insertBefore(".doc-content");
	$(".message").val("已取消黑名单，请按照要求重新申请。");
	$(".bui-ext-close-x").on("click",function(){$(".bui-ext-mask").remove();$(".bui-dialog").remove();$(".doc-content").removeClass("height240");});	
	$(".cancel").on("click",function(){$(".bui-ext-mask").remove();$(".bui-dialog").remove();$(".doc-content").removeClass("height240");});	
	var uri = "/?a=sendmsg&m=home&c=admin&tp=reject";
	SendIoOnBtn(".submit",uri);
}
function rejectshop_box(usernick,mixednick){
	$(".doc-content").addClass("height240");
	$(mask).insertBefore(".doc-content");
	$(dialog_prepair(usernick,mixednick,0,'reject','驳回')).insertBefore(".doc-content");
	$(".reject").on("click",function(){
		if($(this).attr('data-check')==1){
			$(this).attr('data-check','0');
			$(".message").val("抱歉，您的申请未通过审核。原因如下：");
		}else{
			$(this).attr('data-check','1');
			$(".message").val("抱歉，您已被禁止参与本站活动。");
		}
	});
	$(".bui-ext-close-x").on("click",function(){$(".bui-ext-mask").remove();$(".bui-dialog").remove();$(".doc-content").removeClass("height240");});	
	$(".cancel").on("click",function(){$(".bui-ext-mask").remove();$(".bui-dialog").remove();$(".doc-content").removeClass("height240");});	
	var uri = "/?a=sendmsg&m=home&c=admin&tp=reject";
	SendIoOnBtn(".submit",uri);
}
function SendIoOnBtn(btn,uri){
	$(btn).on("click",function(){
		var usernick = $(".usernick").val();
		var mixednick = $(".mixednick").val();
		var message = $(".message").val();
		var msgid = $(".msgid").val();
		var blacklist = $(".reject").attr('data-check');
		if(message==""){
			alert("消息为空！");
		}else{
			KISSY.io({
				//指定 callback 的参数,请求 url 会生成 "url?callback={$jsonpCallback}"
				//jsonpCallback: "jsonp100",
				//指定 callback 的别名,请求url会生成 "url?{$jsonp}=jsonp123456"， 默认就是callback
				//jsonp: "callback" ,
				//url 地址
				url: uri,
				// url: "/?a=ajax&m=Admin",
				//string|json发起请求需要附加的数据,默认为 null
				data: {"usernick":usernick,"mixednick":mixednick,"message":message,"msgid":msgid,"blacklist":blacklist},
				// function请求成功的回调,回调参数为 data(内容),textStatus(请求状态),xhr(ajax对象)
				success: function(data, textStatus) {
				$('.xicon'+msgid).removeClass("x-icon-disable");
				$('.xicon'+msgid).addClass("x-icon-info");
				$('.icon'+msgid).removeClass("icon-minus-mini");
				$('.icon'+msgid).addClass("icon-white icon-plus-mini");
				$('.icon'+msgid).attr("data-key",msgid);
				if($('.count'+msgid).index()!=-1){
					var html = "<span><b>+</b></span>";
					$('.count'+msgid).empty();
					$(html).appendTo('.count'+msgid);
					loadmore('.icon'+msgid);
				}
					if(data.status==1||data.status==2||data.status==3||data.status==5){
						$(".x-icon"+data.mixednick).removeClass("x-icon-success x-icon-warning x-icon-error label-inverse");
						$(".icon"+data.mixednick).removeClass("icon-ok icon-ban-circle  icon-question-sign icon-warning icon-refresh");
						$(".bui-ext-mask").remove();$(".bui-dialog").remove();$(".doc-content").removeClass("height240");
						switch(data.status){
							case 1 :
								$(".x-icon"+data.mixednick).addClass("x-icon-warning");
								$(".icon"+data.mixednick).addClass("icon-warning");
							break;
							case 2:
								$(".x-icon"+data.mixednick).addClass("x-icon-success");
								$(".icon"+data.mixednick).addClass("icon-ok");
							break;
							case 3:
								$(".x-icon"+data.mixednick).addClass("x-icon-error");
								$(".icon"+data.mixednick).addClass("icon-question-sign");
							break;
							case 5:
								$(".x-icon"+data.mixednick).addClass("label-inverse");
								$(".icon"+data.mixednick).addClass("icon-ban-circle");
							break;
						}
						// $(".icon"+mixednick+" .icon").addClass("icon-ok");
					}else if(data.status==4){
						alert("对象用户不存在！");
					}else{
						alert("发送消息失败！");
					}
				},
				//function 请求完成的回调，在 success 调用之后触发,参数同 success
				complete: function(data){
				},
				// 请求错误时的回调
				error: function(){
					alert('error');
				},
				//发送请求类型是jsonp
				dataType:"jsonp"
			});
		}
	});
}
function sendmsg_box(usernick,mixednick,msgid){
	// $(".button-danger").on("click",function(){
		$(".doc-content").addClass("height240");
		$(mask).insertBefore(".doc-content");
		$(dialog_prepair(usernick,mixednick,msgid)).insertBefore(".doc-content");
		$(".bui-ext-close-x").on("click",function(){$(".bui-ext-mask").remove();$(".bui-dialog").remove();$(".doc-content").removeClass("height240");});	
		$(".cancel").on("click",function(){$(".bui-ext-mask").remove();$(".bui-dialog").remove();$(".doc-content").removeClass("height240");});	
		var uri = "/?a=sendmsg&m=home&c=admin";
		SendIoOnBtn('.submit',uri)
	// });
}
$('.pagination').empty();
setPage($('.pagination'),$('.pagination').attr("data-totalpg"),$('.pagination').attr("data-curpg"));
// function show_tip(select,top,left){
	// $(select).on("mouseenter mouseleave",function(){
		// var width=KISSY.DOM.viewportWidth();
		// if(width >990){width=(width-990)/2+left}else{width=left}
		// $(select+"-tip").toggleClass("hide");
		// DOM.css(select+'-tip', "top",top+"px");
		// DOM.css(select+'-tip', "left",width+"px");
	// });
// }
// function show_tip(select,info){
	 // info = $('.'+select).attr("data-tip");
	// var temp = '';
	// temp+='<div class="'+select+'-tip bui-overlay bui-ext-position tips tips-small tips-info tips-no-icon hide" style="top:-9999px; left:-9999px;">';
	// temp+='<div class="tips-content">'+info+'</div>';
	// temp+='</div>';
	// $(temp).insertAfter('.'+select);
	// var top = $('.'+select).offset().top+75;
	// var left = $('.'+select).offset().left-217;
	// $('.'+select).on("mouseenter mouseleave",function(){
		// var width=KISSY.DOM.viewportWidth();
		// if(width >990){width=(width-990)/2+left}else{width=left}
		// $('.'+select+"-tip").toggleClass("hide");
		// DOM.css('.'+select+'-tip', "top",top+"px");
		// DOM.css('.'+select+'-tip', "left",width+"px");
	// });
// }
});